function e(a, i) {
    var u = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, c = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
    return new Promise(function(r, f) {
        c.success = function(e) {
            r(e);
        }, c.fail = function(e) {
            r(e);
        }, c.header = Object.assign(c.header || {}, c.noToken ? {} : {
            authorization: t.globalData.authToken
        });
        var s = wx.uploadFile({
            url: c.fullPath ? a : l + a,
            filePath: i,
            name: "file",
            formData: u,
            header: c.header,
            success: function(t) {
                n({
                    res: t,
                    upload: e,
                    url: a,
                    filePath: i,
                    formData: u,
                    config: c,
                    type: "upload"
                });
            },
            fail: function(e) {
                o(e, a, c);
            },
            complete: function() {
                "function" == typeof c.complete && c.complete();
            }
        });
        "function" == typeof c.callback && c.callback(s);
    });
}

var t = getApp(), a = require("C730AF20A71FB5DFA156C7279F1CA4D1.js"), n = a.netSuccess, o = a.netFail, l = require("B7F487A3A71FB5DFD192EFA4970CA4D1.js").BASE_URL;

module.exports = {
    upload: e
};